package org.luxor.accesslog.service;


import org.luxor.accesslog.entity.AccessLogEntity;
import org.luxor.accesslog.entity.AccessLogQuery;
import org.luxor.commons.elasticsearch.metadata.EsPageQuery;
import org.luxor.commons.elasticsearch.metadata.EsPageResult;

/**
 * 访问审计日志服务
 *
 * @author Mr.yan @date 2020/3/14
 */
public interface IAccessLogService {

    /**
     * 记录访问审计日志
     *
     * @param accessLog
     */
    void saveLog(AccessLogEntity accessLog);

    /**
     * 分页查询
     *
     * @param query
     * @return
     */
    EsPageResult<AccessLogEntity> pageContent(EsPageQuery<AccessLogQuery> query);

    /**
     * 清除历史记录(默认保留15天)
     */
    void flush();
}
